(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0) → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0) → false
le(0, Y) → true
gcd(0, Y) → 0
gcd(s(X), 0) → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0') → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0') → false
le(0', Y) → true
gcd(0', Y) → 0'
gcd(s(X), 0') → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0') → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0') → false
le(0', Y) → true
gcd(0', Y) → 0'
gcd(s(X), 0') → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
minus,
le,
gcdThey will be analysed ascendingly in the following order:
minus < gcd
le < gcd
(6) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
minus, le, gcd
They will be analysed ascendingly in the following order:
minus < gcd
le < gcd
(7) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol minus.
(8) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
le, gcd
They will be analysed ascendingly in the following order:
le < gcd
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
le(
gen_s:0'3_0(
+(
1,
n1955_0)),
gen_s:0'3_0(
n1955_0)) →
false, rt ∈ Ω(1 + n1955
0)
Induction Base:
le(gen_s:0'3_0(+(1, 0)), gen_s:0'3_0(0)) →RΩ(1)
false
Induction Step:
le(gen_s:0'3_0(+(1, +(n1955_0, 1))), gen_s:0'3_0(+(n1955_0, 1))) →RΩ(1)
le(gen_s:0'3_0(+(1, n1955_0)), gen_s:0'3_0(n1955_0)) →IH
false
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
le(gen_s:0'3_0(+(1, n1955_0)), gen_s:0'3_0(n1955_0)) → false, rt ∈ Ω(1 + n19550)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
gcd
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol gcd.
(13) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
le(gen_s:0'3_0(+(1, n1955_0)), gen_s:0'3_0(n1955_0)) → false, rt ∈ Ω(1 + n19550)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
No more defined symbols left to analyse.
(14) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
le(gen_s:0'3_0(+(1, n1955_0)), gen_s:0'3_0(n1955_0)) → false, rt ∈ Ω(1 + n19550)
(15) BOUNDS(n^1, INF)
(16) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
le(gen_s:0'3_0(+(1, n1955_0)), gen_s:0'3_0(n1955_0)) → false, rt ∈ Ω(1 + n19550)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
No more defined symbols left to analyse.
(17) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
le(gen_s:0'3_0(+(1, n1955_0)), gen_s:0'3_0(n1955_0)) → false, rt ∈ Ω(1 + n19550)
(18) BOUNDS(n^1, INF)